package com.cneport.transfer.util;

import sun.misc.BASE64Decoder;

public abstract class Base64EncodeUtil {

	public static String deCode(String message) {
		if (message == null)
			return null;
		BASE64Decoder decoder = new BASE64Decoder();
		try {
			byte[] b = decoder.decodeBuffer(message);
			return new String(b);
		} catch (Exception e) {
			return null;
		}
	}
	public static String encode(String message) {
		if (message == null)
			return null;
		return (new sun.misc.BASE64Encoder()).encode(message.getBytes());
	}
	
}
